var vote= new Vue({
    el : '#Votelist',
    data:{
        userId : $("#id").val(),
        xiangmuId:$("#xiangmuId").val(),
        xiangmuleixing:$("#xiangmuleixing").val(),
        detailid: "",
        pinzhong:"",
        pinpai:"",
        xiangmu : {},
        shiyongyuanze:{},
        yiyongyuanze:{},
        syyz_value: [],
        shiyongyuanzelist:[],
        votelist:[],
        show : false,
        total:0,
        tongyishu:0,
        butongyishu:0,
        checkAll: false,
        checkedCities: [],
        isIndeterminate: true,
        issubmited:false,

        pageIndex : 1,
        pageSize :1,
        pageCount : 0,
        recordCount : 0,
        inputPageIndexValue : "",
    },
    created : function() {
        var _this = this;

        $(".nav navbar-nav li").removeClass("active");
        $("#nav_biaojue").addClass("active");
        _this.findIsacticed();


    },
    mounted() {

    },
    methods : {
        openSelect() {
            console.log(123)
            this.$refs.selectRef.toggleMenu();
        },
        handleCheckAllChange(val) {
            var ids = this.shiyongyuanzelist.map(item => {
                return item.id
            })
            this.syyz_value = val ? ids : [];
            this.isIndeterminate = false;
            console.log(this.checkedCities)
        },
        handleCheckedCitiesChange(value) {
            var ids = this.shiyongyuanzelist.map(item => {
                return item.id
            })
            let checkedCount = value.length;
            this.checkAll = checkedCount === ids.length;
            this.isIndeterminate = checkedCount > 0 && checkedCount < ids.length;
            this.syyz_value = value
        },
        findIsacticed:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/xiangmu/getIsactivedxiangmu', {
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        var data = ppData.resultContent;
                        _this.xiangmu = data;
                        _this.xiangmuId=_this.xiangmu.xiangmuid;
                        _this.findBiaojuelist();
                        _this.getResultCount();
                        _this.checkIsSubmited();
                        _this.initDict();
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        initDict : function() {

            var _this = this;
            $.post("/dict_shiyongyuanze/find_all", {
                text:"",
                rdm : Math.random()
            }, function (ppData) {
                if (ppData != null) {
                    if (ppData.result == '1') {
                        _this.shiyongyuanzelist = ppData.resultContent;
                    } else {
                        layer.alert(ppData.message);
                    }
                }
            }, "json");
         },
        syyzChange:function (val){
            this.syyz_value = val
        },
        findBiaojuelist:function (){
            var _this = this;
            layer.open({type:3});
            $.post("/yiyonghaocai/findBiaojuelist",{
                xiangmuid :_this.xiangmuId,
                userid :_this.userId,
                pageindex : _this.pageIndex,
                pagesize : _this.pageSize,
                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;
                        var mmHtml = "<div class='table-head'><table class=\"table table-hover table-bordered\" style=\"overflow:hidden; margin-bottom:10px;table-layout:fixed;\" v-if=\"show\" cellspacing=\"0\" cellpadding=\"0\">\n" +
                            "   <thead >\n" +
                            "    <tr style=\"font-weight: bold;\">\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:60px;\" >序号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:60px;\" >品种名</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >品种序号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >品牌</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >型号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:100px;\" >平台编码</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:100px;\" >产品名称</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:100px;\" >产品规格</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:100px;\" >产品型号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:100px;\" >注册证号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:120px;\" >生产商（品牌）</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:50px;\" >计价单位</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >平台情况</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >进口/国产</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >平台单价（元）</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:100px;\" >是否医保</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:110px;\" >简要功能用途</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >备注</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >适用原则</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;\" >表决意见（同意请打勾）</td>\n" +
                            "    </tr>\n" +
                            "   </thead></table></div><div class='table-body'><table style=\"table-layout: fixed;\"><tbody>";
                        if(data.YiyonghaocaiList.length > 0){
                            _this.show = true;
                            _this.yiyonghaocailist=data.YiyonghaocaiList;

                            var PageInfo = data.PageInfo;
                            _this.pageIndex = PageInfo.pageIndex;
                            _this.recordCount = PageInfo.recordCount;
                            _this.pageCount = PageInfo.pageCount;


                            for (var i = 0; i < data.YiyonghaocaiList.length; i++) {
                                var mmYiyonghaocai = data.YiyonghaocaiList[i];

                                var mmPinzhong = mmYiyonghaocai.pinzhongxuhao;
                                var mmPinzhongming = mmYiyonghaocai.pinzhongming;
                                var mmPinpaiList = mmYiyonghaocai.pinpailist;
                                var mmPinzhongHebingshu = mmYiyonghaocai.pinzhonghebinghang;
                                var mmPinzhongHebinghang = "";
                                if (mmPinzhongHebingshu > 1) {
                                    mmPinzhongHebinghang = "rowspan='" + mmPinzhongHebingshu + "'";
                                } else {
                                    mmPinzhongHebinghang = "";
                                }
                               /* var mmHuanhangfu1 = "";
                                if (i != 0) {
                                    mmHuanhangfu1 = "<tr>";
                                }
                                mmHtml += "<tr>";
                                mmHtml += mmHuanhangfu1 + "<td style='text-align:center;vertical-align:middle;width: 49px;height: 100%'" + mmPinzhongHebinghang + ">" + mmPinzhong + "</td>";
*/
                                for (var j = 0; j < mmPinpaiList.length; j++) {
                                    var s=0;
                                    var mmPinpailist = mmPinpaiList[j];
                                    var mmPinpai = mmPinpailist.pinpaixuhao;
                                    var mmResult=mmPinpailist.result;
                                    var mmshiyongyuanze=mmPinpailist.shiyongyuanzeid;

                                    var mmPinpaiHebingshu = mmPinpailist.pinpaihebinghang;
                                    var mmXinghaolist= mmPinpailist.xinghaolist;
                                    var mmPinpaiHebingshu = mmPinpailist.pinpaihebinghang;
                                    var mmPinpaiHebinghang = "";
                                    if (mmPinpaiHebingshu > 1) {
                                        mmPinpaiHebinghang = "rowspan='" + mmPinpaiHebingshu + "'";
                                    } else {
                                        mmPinpaiHebinghang = "";
                                    }

                                    for (var k = 0; k < mmXinghaolist.length; k++) {

                                        var mmxinghaolist = mmXinghaolist[k];
                                        var mmId=mmxinghaolist.id;
                                        var mmOrdernumber = mmxinghaolist.ordernumber;
                                        var mmXinghaocaifen = mmxinghaolist.xinghaoxuhao;
                                        var mmPingtaibianma = mmxinghaolist.pingtaibianma;
                                        var mmZhucezhengmingcheng = mmxinghaolist.zhucezhengmingcheng;
                                        var mmchanpinmingcheng = mmxinghaolist.chanpinmingcheng;
                                        var mmGuige = mmxinghaolist.chanpinguige;
                                        var mmXinghao = mmxinghaolist.chanpinxinghao;
                                        var mmzhucezhenghao = mmxinghaolist.zhucezhenghao;
                                        var mmshengchanshang = mmxinghaolist.shengchanshangpinpai;
                                        var mmjijiadanwei = mmxinghaolist.jijiadanwei;
                                        var mmpingtaiqingkuang = mmxinghaolist.pingtaiqingkuang;
                                        var mmjinkouguochan = mmxinghaolist.jinkouguochan;
                                        var mmPingtaidanjia = mmxinghaolist.pingtaidanjia;
                                        var mmgongnengyongtu = mmxinghaolist.gongnengyongtu;
                                        var mmshifouyibao = mmxinghaolist.text10;
                                        var mmbeizhu = mmxinghaolist.text11;

                                        var mmHuanhangfu3 = "";
                                        var mmerjihe="";
                                        var mmyijihe="";
                                        var mmsanjihe="";
                                        if(mmPinzhong%2==0){//品种偶数行有颜色
                                            mmHuanhangfu3 +="<tr style='background-color: #f2f2f2'>"
                                        }else {
                                            mmHuanhangfu3 +="<tr>"
                                        }
                                        if(mmPinzhong%2==0){//品种偶数行
                                            if (k != 0) {//型号不是第一行
                                                mmHuanhangfu3 = "<tr style='background-color: #f2f2f2'>";
                                            }else{//型号第一行
                                                mmerjihe="<td style='text-align:center;vertical-align:middle;width: 80px;height: 100%'  rowspan='" + mmPinpaiHebingshu + "'>" + mmPinpai + "</td>";
                                            }
                                        }else {//品种奇数行
                                            if (k != 0) {
                                                mmHuanhangfu3 = "<tr>";
                                            }else{
                                                mmerjihe="<td style='text-align:center;vertical-align:middle;width: 80px;height: 100%'  rowspan='" + mmPinpaiHebingshu + "'>" + mmPinpai + "</td>";
                                            }
                                        }
                                       /* if (k != 0) {
                                            mmHuanhangfu3 = "<tr>";
                                        }else{
                                            mmerjihe="<td style='text-align:center;vertical-align:middle;width: 80px;height: 100%'  rowspan='" + mmPinpaiHebingshu + "'>" + mmPinpai + "</td>";
                                        }*/
                                        if(j==0 &&s==0){
                                            mmyijihe= "<td style='text-align:center;vertical-align:middle;width: 60px;height: 100%'  rowspan='" + mmPinzhongHebingshu + "'>" + mmPinzhongming + "</td>";
                                            mmyijihe+= "<td style='text-align:center;vertical-align:middle;width: 80px;height: 100%'  rowspan='" + mmPinzhongHebingshu + "'>" + mmPinzhong + "</td>";
                                            s= 1;
                                        }


                                        mmHtml += mmHuanhangfu3 + "<td style='text-align:center;vertical-align:middle;width: 60px;'>" + mmOrdernumber + "</td>";
                                        mmHtml +=mmyijihe;
                                        mmHtml +=mmerjihe;
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;'>" + mmXinghaocaifen + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmPingtaibianma + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmchanpinmingcheng + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a title='" + mmGuige + "'>" + mmGuige + "</a></td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a title='" + mmXinghao + "'>" + mmXinghao + "</a></td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmzhucezhenghao + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:120px;'>" + mmshengchanshang + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:50px;'>" + mmjijiadanwei + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;'>" + mmpingtaiqingkuang + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;'>" + mmjinkouguochan + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;'>" + mmPingtaidanjia + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:100px;'>" + mmshifouyibao + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:110px;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a title='" + mmgongnengyongtu + "'>" + mmgongnengyongtu + "</a></td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;'>" + mmbeizhu + "</td>";


                                        var mmBtndiv="";
                                        if(_this.issubmited){
                                            if(mmResult==null||mmResult==0){
                                                mmBtndiv="<div  id='div_"+mmPinzhong+"_"+mmPinpai+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\" disabled onclick=\"toVote('"+mmId+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmPinzhong+"_"+mmPinpai+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                            if(mmResult==1){
                                                mmBtndiv="<div id='div_"+mmPinzhong+"_"+mmPinpai+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\" disabled checked onclick=\"toVote('"+mmId+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmPinzhong+"_"+mmPinpai+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                        }
                                        if(!_this.issubmited) {
                                            if(mmResult==null||mmResult==0){
                                                mmBtndiv="<div id='div_"+mmPinzhong+"_"+mmPinpai+"' style=\"text-align:center;\"><input  style=\"height:20px;width: 20px;\"  onclick=\"toVote('"+mmId+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmPinzhong+"_"+mmPinpai+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                            if(mmResult==1){
                                                mmBtndiv="<div id='div_"+mmPinzhong+"_"+mmPinpai+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\" checked  onclick=\"toVote('"+mmId+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmPinzhong+"_"+mmPinpai+"'  class='cbcss' type=\"checkbox\"></div>";
                                            }
                                        }
                                        if (mmshiyongyuanze!=undefined) {

                                            var mmBtn="<span><div id='div_"+mmId+"_shiyongyuanze' style=\"text-align:center;\">" + mmshiyongyuanze + "</div></span><span class=\"btn btn-primary\" style=\"\"\n" +
                                                "                  onclick=\"toModify('"+mmId+"','"+mmPinzhong+"','"+mmPinpai+"')\">选择</span>";
                                        } else {
                                            var mmBtn="<span><div id='div_"+mmId+"_shiyongyuanze' style=\"text-align:center;\"></div></span><span class=\"btn btn-primary\" style=\"\"\n" +
                                                "                  onclick=\"toModify('"+mmId+"','"+mmPinzhong+"','"+mmPinpai+"')\">选择</span>";
                                        }

                                        if (k==0) {
                                            mmHtml +="<td style='text-align:center;vertical-align:middle;width:80px;height: 100%'" + mmPinpaiHebinghang + ">" + mmBtn + "</td>";
                                            mmHtml +="<td style='text-align:center;vertical-align:middle;height: 100%'" + mmPinpaiHebinghang + ">" + mmBtndiv + "</td>";
                                        }
                                        mmHtml += "</tr>";

                                    }

                                }

                            }
                        }else {
                            _this.show = false;
                        }
                        mmHtml += "</table>";
                        $("#List").html(mmHtml);
                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },
        getResultCount:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/yiyongjieguo/getResultCount', {
                xiangmuid :_this.xiangmuId,
                userid :_this.userId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        var data = ppData.resultContent;
                        _this.tongyishu=data.tongyiShu;
                        _this.total=data.total;
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        checkIsSubmited:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/renyuanfenpei/checkIsSubmited', {
                xiangmuid :_this.xiangmuId,
                userid :_this.userId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                         if(ppData.resultContent=="1"){
                             _this.issubmited=true;
                         }
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        tosubmit:function (){
            var _this = this;
            layer.confirm("请核对信息，提交之后不能修改吗？",{
                    btn : ['是','否']
                },function(){
            layer.open({type:3});
            $.post('/yiyongjieguo/submit', {
                xiangmuid :_this.xiangmuId,
                userid :_this.userId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        _this.issubmited=true;
                        layer.alert("提交成功");
                        _this.findIsacticed();

                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
            })
        },
        toVoteSure:function (){
            var _this = this;
            layer.open({type: 3});
            $.post('/yiyongjieguo/votesure', {
                xiangmuid: _this.xiangmuId,
                userid:_this.userId,
                rdm: Math.random()
            }, function (ppData) {
                layer.closeAll("loading");
                if (ppData != null) {
                    if (ppData.result == "1") {
                        layer.alert("勾选成功");
                        _this.findIsacticed();
                    } else {
                        layer.alert(ppData.message);
                    }
                }
            }, "json");
        },
        bindShiyongyuanze:function (){
            // this.$refs.selectRef.toggleMenu();
            var _this = this;
            layer.open({type:3});
            $.post('/yiyongyuanze/find_one', {
                detailid : _this.detailid,
                pinzhong : _this.pinzhong,
                pinpai : _this.pinpai,
                xiangmuid: _this.xiangmuId,
                userid:_this.userId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        _this.syyz_value = []
                        var data = ppData.resultContent;
                        _this.yiyongyuanze = data;
                        //console.log(ppData.resultContent[0].shiyongyuanzeid)
                        // $("#shiyongyuanze").selectpicker('val', []);//否则下拉框旧值不刷新
                        // $("#shiyongyuanze").selectpicker('refresh');
                        //render方法强制重新渲染引导程序 - 选择ui,如果当您编程时更改任何相关值而影响元素布局，这将非常有用。
                        // $("#shiyongyuanze").selectpicker('render');
                        _this.initDict();
                        if(data.length > 0)
                        {
                            _this.syyz_value = ppData.resultContent[0].shiyongyuanzeid.split(',')
                          /*  var arr=data.shiyongyuanze.split(',');
                            _this.yiyongyuanze.shiyongyuanze=arr;
                            $("#shiyongyuanze").selectpicker('val', arr);*/
                        }else
                        {
                           /* _this.initDict();*/
                            _this.yiyongyuanze.shiyongyuanze=[];
                        }
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        modifyShiyongyuanze:function (){
            var _this = this;
            if(_this.syyz_value.join(',')==""){
                layer.alert("请选择适用原则再保存。");
                return false;
            }
            var shiyongyuanze=_this.syyz_value.join(',');

                $.post('/yiyongyuanze/jiancha', {
                    detailid : _this.detailid,
                    pinzhong : _this.pinzhong,
                    pinpai : _this.pinpai,
                    xiangmuid: _this.xiangmuId,
                    userid:_this.userId,
                    shiyongyuanzeid: _this.syyz_value.join(','),
                    rdm : Math.random()
                },function(ppData) {
                    layer.closeAll("loading");
                    if(ppData != null){
                        if(ppData.result == "1"){
                            $.post('/yiyongyuanze/save', {
                                detailid : _this.detailid,
                                pinzhong : _this.pinzhong,
                                pinpai : _this.pinpai,
                                xiangmuid: _this.xiangmuId,
                                userid:_this.userId,
                                shiyongyuanzeid: _this.syyz_value.join(','),
                                rdm : Math.random()
                            },function(ppData) {
                                layer.closeAll("loading");
                                if(ppData != null){
                                    if(ppData.result == "1"){
                                        layer.open({
                                            time:1000,
                                            btn:[],
                                            content:"保存成功!",
                                        });
                                        $("#editShiyongyuanzeModal").modal("hide");
                                        _this.getResultCount();
                                        $("#div_"+_this.detailid+"_shiyongyuanze").html(shiyongyuanze);
                                        $("#div_"+_this.pinzhong+"_"+ _this.pinpai+"").html("<input style=\"height:20px;width: 20px;\"  checked onclick=\"toVote('"+ _this.detailid+"','"+ _this.pinzhong+"','"+ _this.pinpai+"')\" id='checkbox_"+_this.pinzhong+"_"+_this.pinpai+"' class='cbcss' type=\"checkbox\">");
                                    }else{
                                        layer.alert(ppData.message);
                                    }
                                }
                            },"json");
                        }else{
                           /* layer.alert(ppData.message);*/
                            layer.confirm(ppData.message,{
                                btn : ['是','否']
                            },function(){
                                layer.open({type:3});
                                $.post('/yiyongyuanze/save', {
                                    detailid : _this.detailid,
                                    pinzhong : _this.pinzhong,
                                    pinpai : _this.pinpai,
                                    xiangmuid: _this.xiangmuId,
                                    userid:_this.userId,
                                    shiyongyuanzeid: _this.syyz_value.join(','),
                                    rdm : Math.random()
                                },function(ppData) {
                                    layer.closeAll("loading");
                                    if(ppData != null){
                                        if(ppData.result == "1"){
                                            layer.open({
                                                time:1000,
                                                btn:[],
                                                content:"保存成功!",
                                            });
                                            $("#editShiyongyuanzeModal").modal("hide");
                                            _this.getResultCount();
                                            $("#div_"+_this.detailid+"_shiyongyuanze").html(shiyongyuanze);
                                            $("#div_"+_this.pinzhong+"_"+ _this.pinpai+"").html("<input style=\"height:20px;width: 20px;\"  checked onclick=\"toVote('"+ _this.detailid+"','"+ _this.pinzhong+"','"+ _this.pinpai+"')\" id='checkbox_"+_this.pinzhong+"_"+_this.pinpai+"' class='cbcss' type=\"checkbox\">");
                                        }else{
                                            layer.alert(ppData.message);
                                        }
                                    }
                                },"json");
                            })



                        }
                    }
                },"json");
        },
        /*modifyShiyongyuanze:function (){
            var _this = this;
            if(_this.syyz_value.join(',')==""){
                layer.alert("请选择适用原则再保存。");
                return false;
            }
            var shiyongyuanze=_this.syyz_value.join(',');

            $.post('/yiyongyuanze/save', {
                detailid : _this.detailid,
                pinzhong : _this.pinzhong,
                pinpai : _this.pinpai,
                xiangmuid: _this.xiangmuId,
                userid:_this.userId,
                shiyongyuanzeid: _this.syyz_value.join(','),
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        layer.open({
                            time:1000,
                            btn:[],
                            content:"保存成功!",
                        });
                        $("#editShiyongyuanzeModal").modal("hide");
                        _this.getResultCount();
                        $("#div_"+_this.detailid+"_shiyongyuanze").html(shiyongyuanze);
                        $("#div_"+_this.pinzhong+"_"+ _this.pinpai+"").html("<input style=\"height:20px;width: 20px;\"  checked onclick=\"toVote('"+ _this.detailid+"','"+ _this.pinzhong+"','"+ _this.pinpai+"')\" id='checkbox_"+_this.pinzhong+"_"+_this.pinpai+"' class='cbcss' type=\"checkbox\">");
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },*/


        //跳到首页
        SetPageIndex : function(){
            this.pageIndex = 1;
        },
        SetPageEnd : function(){
            this.pageIndex = this.pageCount;
        },
        //上一页
        SetPageIndexPrePage : function(){
            var PrePage = ((this.pageIndex -1) <= 0) ? 1 : (this.pageIndex -1);
            this.pageIndex = PrePage;
        },
        //下一页
        SetPageIndexNextPage : function(){
            var NextPage = ((this.pageIndex +1) >= this.pageCount) ? this.pageCount : (this.pageIndex +1);
            this.pageIndex = NextPage;
        },
        //跳转界面
        JumpPage : function(){
            if(this.inputPageIndexValue <= 1){
                this.inputPageIndexValue = 1;
            }else if(this.inputPageIndexValue >= this.pageCount){
                this.inputPageIndexValue = this.pageCount;
            }
            this.pageIndex = this.inputPageIndexValue;
            this.inputPageIndexValue = '';
        },
    },
    watch :{
        //监控分页情况，刷新列表
        pageIndex : function(){

            this.findBiaojuelist();
        }
    }
})